EMT Practice Test

1. Question Content...


Question List

Question1: In which two org types can a developer create new Apex Classes? Choose 2 answers

Question2: A company has a custom object named Region. Each account in salesforce can only be related to one region at a time, but this relationship is optional. Which type of relantionship should a developer use to relate an account to a region?

Question3: When are code coverage calculations updated?

Question4: Universal Containers requires Service Representatives to update all Cases at least one every three days. To make sure of this policy is obeyed, a developer has been asked to implement a field that displays the number of days since the last Case update. What should the developer use to configure the solution?

Question5: A developer needs to test an Invoicing system integration. After reviewing the number of transactions required for the test, the developer estimates that the test data will total about 2 GB of data storage. Production data is not required for the integration testing.
Which two environments meet the requirements for testing? (Choose two.)

Question6: What is a capability of the Developer Console?

Question7: A developer needs to create an audit trail for records that are sent to the recycle bin. Which type of trigger is most appropriate to create?

Question8: Which three options can be accomplished with formula fields? (Choose three.)

Question9: A developer is asked to write negative tests as part of the unit testing for a method that calculates a person's age based on birth date. What should the negative tests include?

Question10: Which approach should be used to provide test data for a test class?

Question11: In a single record, a user selects multiple values from a multi-select picklist.
How are the selected values represented in Apex?

Question12: Developer needs to automatically populate the Reports To field in a Contact record based on the values of the related Account and Department fields in the Contact record. Which type of trigger would the developer create? Choose 2 answers

Question13: A developer runs the following anonymous code block in a Salesforce org with 100 accounts List acc= {select id from account limit 10}; delete acc; database.emptyrecyclebin(acc); system.debug(limits.getlimitqueries()+'
,'+Limits.getlimitDMLStatements()); What is the debug output?

Question14: Account acct = {SELECT Id from Account limit 1}; Given the code above, how can a developer get the type of object from acct?

Question15: Which two condition cause workflow rules to fire? Choose 2 answers

Question16: How can a developer set up a debug log on a specific user?

Question17: A custom exception "RecordNotFoundException" is defined by the following code of block.public class RecordNotFoundException extends Exception()which statement can a developer use to throw a custom exception?choose 2 answers

Question18: A developer wrote a unit test to confirm that a custom exception works properly in a custom controller, but the test failed due to an exception being thrown. What step should the developer take to resolve the issue and properly test the exception?

Question19: A developer created a Lightning component to display a short text summary for an object and wants to use it with multiple Apex classes.
How should the developer design the Apex classes?

Question20: How would a developer change the field type of a custom field on the Account object from string to an integer?

Question21: The sales management team requires that the lead source field of the Lead record be populated when Lead is converted. What would a developer use to ensure that a user populates the Lead source field?

Question22: What is a capability of a StandardSetController?Choose 2 answers

Question23: A platform developer at Universal Containers needs to create a custom button for the Account object that, when clicked, will perform a series of calculations and redirect the user to a custom Visualforce page.
Which three attributes need to be defined with values in the <apex:page> tag to accomplish this? (Choose three.)

Question24: In the Lightning Component framework, where is client-side controller logic contained?

Question25: A developer creates a Workflow Rule declaratively that updates a field on an object. An Apex update trigger exists for that object. What happens when a user updates a record?

Question26: What is accurate statement about with sharing keyword? Choose 2 answers

Question27: What is a characteristic of the Lightning Component Framework? Choose 2 answers:

Question28: Which code segment can be used to control when the dowork() method is called?

Question29: An org has different Apex Classes that provide Account -related functionality.After a new validation rule is added to the object, many of the test methods fail.What can be done to resolve the failures and reduce the number of code changes needed for future validation rules?Choose 2 answers:

Question30: A developer creates an Apex Trigger with the following code block:List<Account> customers = new List<Account>();For (Order__c o: trigger.new){Account a = [SELECT Id, Is_Customer__c FROM Account WHERE Id
:o.Customer__c];a.Is_Customer__c = true;customers.add(a);}Database.update(customers, false);The developer tests the code using Apex Data Loader and successfully loads 10 Orders. Then, the developer loads 150 Orders.How many Orders are successfully loaded when the developer attempts to load the 150 Orders?

Question31: A developer in a Salesforce org with 100 Accounts executes the following code using the Developer console:
Account myAccount = new Account(Name = 'MyAccount');Insert myAccount;For (Integer x = 0; x < 250; x++)
{Account newAccount = new Account (Name='MyAccount' + x);try {Insert newAccount;}catch (Exception ex) {System.debug (ex) ;}}insert new Account (Name='myAccount'); How many accounts are in the org after this code is run?

Question32: A developer wants to store a description of a product that can be entered on separate lines by a user during product setup and later displayed on a Visualforce page for shoppers. Which field type should the developer choose to ensure that the description will be searchable in the custom Apex SOQL queries that are written?

Question33: Which statement is true about developing in a multi-tenant environment?

Question34: When would a developer use a custom controller instead of a controller extension? Choose 2 answers:

Question35: A developer is asked to set a picklist field to 'Monitor' on any new Leads owned by a subnet of Users.
How should the developer implement this request?

Question36: A developer wants to display all of the picklist entries for the Opportunity StageName field and all ofthe available record types for the Opportunity object on a Visualforce page. Which two actions should the developer perform to get the available picklist values and record types in the controller? Choose 2 answers.

Question37: Which action can a developer perform in a before update trigger? (Choose 2)

Question38: Which type of controller should a developer use to include a list of related records for a Custom Object record on a Visualforce page without needing additional test coverage?

Question39: Which two sosl searches will return records matching search criteria contained in any of the searchable text fields on an object? choose 2 answers

Question40: An apex trigger fails because it exceeds governor limits. Which two techniques should a developer use to resolve the problem? Choose 2 answers

Question41: What is a correct pattern to follow when programming in Apex on a Multi-tenant platform?

Question42: A developer needs to provide a Visualforce page that lets users enter Product-specific details during a Sales cycle. How can this be accomplished? (Choose 2)

Question43: The Review_c object have a lookup relationship to the job_Application_c object. The job_Application_c object has a master detail relationship up to the position_c object. The relationship is based on the auto populated defaults?
What is the recommended way to display field data from the related Review _C records a Visualforce page for a single Position_c record? Select one of the following:

Question44: What should a developer use to implement an automatic Approval Process submission for Cases?

Question45: Which query should a developer use to obtain the Id and Name of all the Leads, Accounts, and Contacts that have the company name "Universal Containers"?

Question46: What is an important consideration when developing in a multi-tenant environment?

Question47: An org has a single account named 'NoContacts' that has no related contacts. Given the query:
List<Account> accounts = [Select ID, (Select ID, Name from Contacts) from Account where Name='NoContacts']; What is the result of running this Apex?

Question48: A developer executes the following query in Apex to retrieve a list of contacts for each account:
List<account> accounts = [Select ID, Name, (Select ID, Name from Contacts) from Account] ; Which two exceptions may occur when it executes? (Choose two.)

Question49: A candidate may apply to multiple jobs at the company Universal Containers by submtting a single application per job posting. Once an application is submitted for a job posting, that application cannot be modified to be resubmitted to a different job posting.What can the administrator do to associate an application with each job posting in the schema for the organization?

Question50: The Sales Management team hires a new intern. The intern is not allowed to view Opportunities, but needs to see the Most Recent Closed Date of all child Opportunities when viewing an Account record. What would a developer do to meet this requirement?

Question51: Potential home buyers working with a real estate company can make offers on multiple properties that are listed with the real estate company. Offer amounts can be modified; however, the property that has the offer cannot be modified after the offer is placed. What should be done to associate offers with properties in the schema for the organization?

Question52: Which two platform features align to the Controller portion of MVC architecture? (Choose two.)

Question53: A company wants to create an employee rating program that allows employees to rate each other. An employees average rating must be displayed on the employee record. Employees must be able to create rating records, but are not allowed to create employee records. Which two actions should a developer take to accomplish this task?

Question54: Which action can a developer take to reduce the execution time of the following code? List<account> allaccounts = [select id from account]; list<account> allcontacts = [select id, accountid from contact]; for (account a :allaccounts){ for (contact c:allcontacts){ if(c.accountid = a.id){ //do work } } }

Question55: What is the result of the debug statements in testMethod3 when you create test data using testSetup in below code?

Question56: What is considered the primary purpose for creating Apex tests?

Question57: To which primitive data type is a text area (rich) field automatically assigned?

Question58: A developer is creating a Visualforce page that allows users to create multiple Opportunities. The developer is asked to verify the current user's default Opportunity record type, and set certain default values based on the record type before inserting the record. How can the developer find the current user's default record type?

Question59: A developer has javascript code that needs to be called by controller functions in multiple components by extending a new abstract component. Which resource in the abstract component bundle allows the developer to achieve this

Question60: Why would a developer consider using a custom controller over a controller extension?

Question61: How should the developer overcome this problem? While writing a test class that covers an OpportunityLineItem trigger, a Developer is unable to create a standard Pricebook since one already exist in the org.

Question62: A developer needs to know if all tests currently pass in a Salesforce environment. Which feature can the developer use? (Choose 2)

Question63: Which feature allows a developer to create test records for use in test classes?

Question64: Which two statements can a developer use to throw a custom exception of type MissingFieldValueException?
Choose 2 answers.

Question65: Which statement is true about a hierarchical relationship as it pertains to user records?

Question66: How should a developer make sure that a child record on a custom object, with a lookup to the Account object, has the same sharing access as its associated account?

Question67: When an Account's custom picklist field called Customer Sentiment is changed to a value of "Confused", a new related Case should automatically be created.
Which two methods should a developer use to create this case? (Choose two.)

Question68: A developer creates an Apex class that includes private methods. What can the developer do to ensure that the private methods can be accessed by the test class?

Question69: A Visual force page displays two fields named Phone Number and Email.User1 has access to Phone Number, but not to Email.User2 has access to Email, but not Phone NumberA developer needs to ensure that User1 can only see Phone Number, and User2 can only see Email.Which method can the developer use to achieve this?

Question70: A developer writes a before insert trigger.How can the developer access the incoming records in the trigger body?

Question71: A developer has the following code block:
public class PaymentTax {public static decimal SalesTax = 0.0875;} trigger OpportunityLineItemTrigger on OpportunityLineItem (before insert, before update) {PaymentTax PayTax = new PaymentTax();decimal ProductTax = ProductCost * XXXXXXXXXXX;} To calculate the productTax, which code segment would a developer insert at the XXXXXXXXXXX to make the value the class variable SalesTax accessible within the trigger?

Question72: Why would a developer use Test. startTest( ) and Test.stopTest( )?

Question73: What is the data type returned by the following SOSL search? {FIND 'Acme*' in name fields returning account,opportunity};

Question74: When the number of record in a recordset is unknown, which control statement should a developer use to implement a set of code that executes for every record in the recordset, without performing a .size() or
.length() method call?

Question75: For which example task should a developer use a trigger rather than a workflow rule?

Question76: Given the code below, which three statements can be used to create the controller variable? Public class accountlistcontroller{ public list<account>getaccounts(){ return controller.getrecords(); } } Choose 3 answers

Question77: A Platform Developer needs to write an Apex method that will only perform an action if a record is assigned to a specific Record Type.
Which two options allow the developer to dynamically determine the ID of the required Record Type by its name? (Choose two.)

Question78: How are debug levels adjusted In the Developer Console?

Question79: What is a capability of the Force.com IDE? Choose 2 answers

Question80: What are the eight officially supported languages on Heroku platform?

Question81: What is the advantage of Salesforce Lightning?

Question82: A developer needs to avoid potential system problems that can arise in a multi-tenant architecture. Which requirement helps prevent poorty written applications from being deployed to a production environment?

Question83: What is the accurate statement about with sharing keyword? choose 2 answers

Question84: A developer executes the following code in the Developer Console:
List<Account> fList = new List <Account> ();For(integer i= 1; I <= 200; i++){fList.add(new Account ( Name
= 'Universal Account ' + i));}Insert fList;List <Account> sList = new List<Account>();For (integer I = 201; I
<=
20000; i ++){sList.add(new Account (Name = 'Universal Account ' + i));}Insert sList;How many accounts are created in the Salesforce organization ?

Question85: Which is a valid apex assignment?

Question86: A developer needs to import customer subscription records into salesforce and attach them to existing account records. Which 2 actions should the developer take to ensure the subscription records are related to the correct account records? Choose 2 answers

Question87: A company would like to send an offer letter to a candidate, have the candidate sign it electronically, and then send the letter back.What can a developer do to accomplish this?

Question88: Opportunity opp=[SELECT Id,StageName FROM Opportunity LIMIT 1]; Given the code above,how can a developer get the label for the StageName field?

Question89: A developer uses a Test Setup method to create an Account named 'Test'. The first test method deletes the Account record. What must be done in the second test method to use the Account?

Question90: Which governor limit applies to all the code in an apex transaction?

Question91: What is the requirement for a class to be used as a custom Visualforce controller?

Question92: Which user can edit a record after it has been locked for approval? (Choose 2)

Question93: A developer creates a custom controller and a custom Visualforce page by using the code block below:
public class MyController {
public String myString {
get {
if (myString == null) { myString = 'a';
}
return myString;
} private set; } public string getMyString (){
return 'getMyString';
} public string getStringMethod () {
if (myString == null) {
myString = 'b';
} return myString;
}
} <apex:page controller = "MyController"> {!StringMethod}, {!myString}, {!myString} </apex:page> What can the user expect to see when accessing the custom page?

Question94: Universal Containers wants Opportunities to be locked from editing when reaching the Closed/Won stage.
Which two strategies should a developer use to accomplish this? (Choose two.)

Question95: What is the proper process for an Apex Unit Test

Question96: What are two correct examples of the model in the salesforce MVC architecture? Choose 2 answers.

Question97: What is a capability of the <ltng:require> tag that is used for loading external Javascript libraries in Lightning Component? (Choose three.)

Question98: Which approach should a developer take to automatically add a "Maintenance Plan" to each Opportunity that includes an "Annual Subscription" when an opportunity is closed?

Question99: A developer needs to create a custom visualforce button for the opportunity object page layout that will cause a web service to be called and redirect the user to a new page when clicked. Which three attributes need to be defined in the <apx:page> tag of the visualforce page to enable this functionality?

Question100: What are two benefits of the Lightning Component framework? (Choose two.)

Question101: What are two considerations for deciding to use a roll-up summary field? Choose 2 answer's partner.

Question102: How can a developer warn users of SOQL governor limit violations in a trigger?

Question103: A developer is creating a test coverage for a class and needs to insert records to validate functionality. Which method annotation should be used to create records for every method in the test class?

Question104: A developer needs to display all of the available fields for an object.
In which two ways can the developer retrieve the available fields if the variable myObject represents the name of the object? (Choose two.)

Question105: Which option should a developer use to create 500 Accounts and make sure that duplicates are not created for existing Account Sites?

Question106: Which actions can a developer perform using the Schema Builder?Choose 2 answers

Question107: Which Apex collection is used to ensure that all values are unique?

Question108: Which is a valid Apex assignment?

Question109: On which object can an administrator create a roll-up summary field?

Question110: Which collection type provides unique key/value pairings of data?

Question111: In Lightning component framework, which resource can be used to fire events? Choose 2 answers.

Question112: What are three characteristics of static methods? (Choose three.)

Question113: How can a developer refer to, or instantiate a PageReference in Apex? Choose 2 answers

Question114: A developer uses a test setup method to create an account named 'test'. The first method deletes the account record. What must be done in the second test method to use the account?

Question115: What are two testing consideration when deploying code from a sandbox to production? Choose 2 answers

Question116: Which SOQL query successfully returns the Accounts grouped by name?

Question117: When the value of a field of an account record is updated, which method will update the value of a custom field opportunity? Choose 2 answers.

Question118: When a task is created for a contact, how can a developer prevent the task from being included on the activity timeline of the contact's account record?

Question119: Adeveloper needs to join data received from an integration with an external system with parent records in Salesforce. The data set does not contain the Salesforce IDs of the parent records, but it does have a foreign key attribute that can be used to identify the parent.
Which action will allow the developer to relate records in the data model without knowing the Salesforce ID?

Question120: A developer needs to provide a way to mass edit, update, and delete records from a list view. In which two ways can this be accomplished? Choose 2 answers

Question121: A developer writes the following code:

What is the result of the debug statement?

Question122: Which statement about the Lookup Relationship between a Custom Object and a Standard Object is correct?

Question123: Which set of roll-up types are available when creating a roll-up summary field?

Question124: Using the Schema Builder, a developer tries to change the API name of a field that is referenced in an Apex test class.
What is the end result?

Question125: Which tool can deploy destructive changes to Apex classes in production?

Question126: Which two number expression evaluate correctly? Choose 2 answers

Question127: A reviewer is required to enter a reason in the comments field only when a candidate is recommended to be hired. Which action can a developer take to enforce this requirement?